pub fn length_of_last_word(s: String) -> i32 {
    let mut l = s.len();
    let mut len = 0;
    let mut start = false;

    while l > 0 {
        if start {
            if s.get(l - 1..l).unwrap() == " " {
                break;
            }
            len += 1;
        } else {
            if s.get(l - 1..l).unwrap() != " " {
                start = true;
                len = 1;
            }
        }
        l -= 1;
    }

    return len;
}
